/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow strict-local
 */

import React,{Component} from 'react';
import {
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
  TouchableOpacity,
  NativeModules,
} from 'react-native';

import {
  Colors,
  DebugInstructions,
  Header,
  LearnMoreLinks,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

const styles = StyleSheet.create({
  container: {
    display:'flex',
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'red',
    height: 100
  },
});
 
const RPCommonModule  = NativeModules.RPCommonModule

class App extends Component {
  render() {
    return (
      <SafeAreaView>
        <TouchableOpacity style={styles.container} onPress={event => {
          this.btnClick()
        }}>
          <Text>
            点我
          </Text>
        </TouchableOpacity>

      </SafeAreaView>
    );
  }

  btnClick() {
    console.log(1111)
    RPCommonModule.addEvent(
      'Birthday Party',
      '4 Privet Drive, Surrey'
    );
  }
}
export default App;
